home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / nsapi.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  30.6 KB  |  926 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'NSApi.pas' rev: 3.00
  6.  
  7. #ifndef NSApiHPP
  8. #define NSApiHPP
  9. #include <WinSock.hpp>
  10. #include <Windows.hpp>
  11. #include <SysInit.hpp>
  12. #include <System.hpp>
  13.  
  14. //-- user supplied -----------------------------------------------------------
  15. namespace Nsapi
  16. {
  17.     struct TSession;
  18.     char *servact_translate_uri(char *uri, TSession *sn);
  19. }
  20.  
  21. namespace Nsapi
  22. {
  23. //-- type declarations -------------------------------------------------------
  24. typedef void *PASSWD;
  25.  
  26. typedef void * *PPASSWD;
  27.  
  28. typedef char *TCAddr;
  29.  
  30. typedef char *caddr_t;
  31.  
  32. typedef void __cdecl (*TAtRestart)(void * Data);
  33.  
  34. typedef void __cdecl (*TMagnusAtRestart)(void * Data);
  35.  
  36. typedef void __cdecl (*TDaemonAtRestart)(void * Data);
  37.  
  38. typedef void *pool_handle_t;
  39.  
  40. typedef void *TPoolHandle;
  41.  
  42. typedef void * *PPoolHandle;
  43.  
  44. typedef int Semaphore;
  45.  
  46. typedef void *CRITICAL;
  47.  
  48. typedef void *CONDVAR;
  49.  
  50. struct TFile
  51. {
  52.     int fh;
  53.     char *fname;
  54.     int flsem;
  55. } ;
  56.  
  57. typedef TFile *SYS_FILE;
  58.  
  59. typedef TFile  file_s;
  60.  
  61. typedef int pid_t;
  62.  
  63. typedef int TPid;
  64.  
  65. struct TStat;
  66. typedef TStat *PStat;
  67.  
  68. struct TStat
  69. {
  70.     Word st_dev;
  71.     Word st_ino;
  72.     Word st_mode;
  73.     short st_nlink;
  74.     short st_uid;
  75.     short st_gid;
  76.     Word st_rdev;
  77.     int st_size;
  78.     int st_atime;
  79.     int st_mtime;
  80.     int st_ctime;
  81. } ;
  82.  
  83. typedef TStat  Stat;
  84.  
  85. #pragma pack(push, 1)
  86. struct TDirEnt
  87. {
  88.     char *d_name;
  89. } ;
  90. #pragma pack(pop)
  91.  
  92. typedef TDirEnt *PDirEnt;
  93.  
  94. typedef TDirEnt  dirent_s;
  95.  
  96. struct TDir;
  97. typedef TDir *PDir;
  98.  
  99. struct TDir
  100. {
  101.     int dp;
  102.     _WIN32_FIND_DATAA fdata;
  103.     TDirEnt de;
  104. } ;
  105.  
  106. typedef TDir  dir_s;
  107.  
  108. typedef TDir *SYS_DIR;
  109.  
  110. typedef TDir  SYS_DIRENT;
  111.  
  112. struct tm
  113. {
  114.     int tm_sec;
  115.     int tm_min;
  116.     int tm_hour;
  117.     int tm_mday;
  118.     int tm_mon;
  119.     int tm_year;
  120.     int tm_wday;
  121.     int tm_yday;
  122.     int tm_isdst;
  123. } ;
  124.  
  125. typedef tm *ptm;
  126.  
  127. struct TPbParam
  128. {
  129.     char *name;
  130.     char *value;
  131. } ;
  132.  
  133. typedef TPbParam *PPbParam;
  134.  
  135. typedef TPbParam  pb_param;
  136.  
  137. struct TPbEntry;
  138. typedef TPbEntry *PPbEntry;
  139.  
  140. struct TPbEntry
  141. {
  142.     TPbParam *param;
  143.     TPbEntry *next;
  144. } ;
  145.  
  146. typedef TPbEntry  pb_entry;
  147.  
  148. typedef PPbEntry *PPPbEntry;
  149.  
  150. struct TPblock;
  151. typedef TPblock *PPblock;
  152.  
  153. struct TPblock
  154. {
  155.     int hsize;
  156.     PPbEntry *ht;
  157. } ;
  158.  
  159. typedef TPblock  pblock;
  160.  
  161. typedef char *TPCharArray[134217727];
  162.  
  163. typedef TPCharArray *PPCharArray;
  164.  
  165. typedef int SYS_NETFD;
  166.  
  167. struct TFileBuffer
  168. {
  169.     TFile *fd;
  170.     int fdmap;
  171.     char *fp;
  172.     int len;
  173.     char *inbuf;
  174.     int cursize;
  175.     int pos;
  176.     char *errmsg;
  177. } ;
  178.  
  179. typedef TFileBuffer *PFileBuffer;
  180.  
  181. typedef TFileBuffer  filebuffer;
  182.  
  183. typedef TFileBuffer  filebuf;
  184.  
  185. struct TNetBuf;
  186. typedef TNetBuf *PNetBuf;
  187.  
  188. struct TNetBuf
  189. {
  190.     int sd;
  191.     int pos;
  192.     int cursize;
  193.     int maxsize;
  194.     int rdtimeout;
  195.     char address[64];
  196.     char *inbuf;
  197.     char *errmsg;
  198. } ;
  199.  
  200. typedef TNetBuf  netbuf;
  201.  
  202. struct TSession;
  203. typedef TSession *PSession;
  204.  
  205. struct TSession
  206. {
  207.     TPblock *client;
  208.     int csd;
  209.     TNetBuf *inbuf;
  210.     int csd_open;
  211.     in_addr iaddr;
  212.     void * *pool;
  213.     void *clauth;
  214. } ;
  215.  
  216. typedef TSession  Session;
  217.  
  218. struct TCInfo
  219. {
  220.     char *ctype;
  221.     char *encoding;
  222.     char *language;
  223. } ;
  224.  
  225. typedef TCInfo *PCInfo;
  226.  
  227. typedef TCInfo  cinfo;
  228.  
  229. struct TShMem
  230. {
  231.     void *data;
  232.     int fdmap;
  233.     int size;
  234.     char *name;
  235.     TFile *fd;
  236. } ;
  237.  
  238. typedef TShMem *PShMem;
  239.  
  240. typedef TShMem  shmem_s;
  241.  
  242. typedef void *SYS_THREAD;
  243.  
  244. typedef void __cdecl (*TSysThreadFunc)(void * Arg);
  245.  
  246. struct TMultipleDomains
  247. {
  248.     char *address;
  249.     char *docroot;
  250.     int sd;
  251.     int threads;
  252.     int AddressNumber;
  253. } ;
  254.  
  255. typedef TMultipleDomains *PMultipleDomains;
  256.  
  257. typedef TMultipleDomains  multiple_domains;
  258.  
  259. typedef void __cdecl (*TChildCallback)(PSession sn);
  260.  
  261. typedef void __cdecl (*TRotateCallback)(void);
  262.  
  263. typedef void __cdecl (*TRCBack)(int Param);
  264.  
  265. struct TDaemon
  266. {
  267.     char *ipstr;
  268.     int port;
  269.     TChildCallback child_callback;
  270.     TRotateCallback rotate_callback;
  271.     char *servid;
  272.     TMultipleDomains *domains;
  273.     TRCBack rcback;
  274.     int maxprocs;
  275.     int minprocs;
  276.     int proclife;
  277.     int maxthreads;
  278.     int minthreads;
  279. } ;
  280.  
  281. typedef TDaemon *PDaemon;
  282.  
  283. typedef TDaemon  daemon_s;
  284.  
  285. struct TDirective
  286. {
  287.     TPblock *param;
  288.     TPblock *client;
  289. } ;
  290.  
  291. typedef TDirective *PDirective;
  292.  
  293. typedef TDirective  directive;
  294.  
  295. struct TDtable
  296. {
  297.     int ni;
  298.     TDirective *inst;
  299. } ;
  300.  
  301. typedef TDtable *PDtable;
  302.  
  303. typedef TDtable  dtable;
  304.  
  305. struct THttpdObject
  306. {
  307.     TPblock *name;
  308.     int nd;
  309.     TDtable *dt;
  310. } ;
  311.  
  312. typedef THttpdObject *PHttpdObject;
  313.  
  314. typedef THttpdObject  httpd_object;
  315.  
  316. struct THttpdObjSet;
  317. typedef THttpdObjSet *PHttpdObjSet;
  318.  
  319. struct THttpdObjSet
  320. {
  321.     int pos;
  322.     PHttpdObject *obj;
  323.     PPblock *initfns;
  324. } ;
  325.  
  326. typedef THttpdObjSet  httpd_objset;
  327.  
  328. struct TConfGlobalVars
  329. {
  330.     int Vport;
  331.     char *Vaddr;
  332.     void * *Vuserpw;
  333.     char *Vchr;
  334.     char *Vpidfn;
  335.     int Vpool_max;
  336.     int Vpool_min;
  337.     int Vpool_life;
  338.     int Vpool_maxthreads;
  339.     int Vpool_minthreads;
  340.     char *Vserver_hostname;
  341.     char *Vroot_object;
  342.     THttpdObjSet *Vstd_os;
  343.     void *Vacl_root;
  344.     char *Vmaster_error_log;
  345.     char *Vserver_root;
  346.     char *Vserver_id;
  347. } ;
  348.  
  349. typedef TConfGlobalVars *PConfGlobalVars;
  350.  
  351. typedef TConfGlobalVars  conf_global_vars_s;
  352.  
  353. struct TRequest;
  354. typedef TRequest *PRequest;
  355.  
  356. struct TRequest
  357. {
  358.     TPblock *vars;
  359.     TPblock *reqpb;
  360.     int loadhdrs;
  361.     TPblock *headers;
  362.     int senthdrs;
  363.     TPblock *srvhdrs;
  364.     THttpdObjSet *os;
  365.     THttpdObjSet *tmpos;
  366.     char *statpath;
  367.     char *staterr;
  368.     TStat *finfo;
  369.     int aclstate;
  370.     int acldirno;
  371.     char *aclname;
  372.     TPblock *aclpb;
  373.     BOOL request_is_cacheable;
  374.     BOOL directive_is_cacheable;
  375.     char *cached_headers;
  376.     int cached_headers_len;
  377.     char *cached_date_header;
  378. } ;
  379.  
  380. typedef TRequest  Request;
  381.  
  382. typedef int __cdecl (*TFunction)(PPblock pb, PSession sn, PRequest rq);
  383.  
  384. struct TFuncStruct;
  385. typedef TFuncStruct *PFuncStruct;
  386.  
  387. struct TFuncStruct
  388. {
  389.     char *name;
  390.     TFunction func;
  391.     TFuncStruct *next;
  392. } ;
  393.  
  394. //-- var, const, procedure ---------------------------------------------------
  395. #define PROXY_VERSION_DEF "2.0b4"
  396. #define PROXY_VERSION_STRING "Netscape-Proxy/2.0b4"
  397. #define ADMSERV_VERSION_DEF "2.0"
  398. #define ADMSERV_VERSION_STRING "Netscape-Administrator/2.0"
  399. #define PERSONAL_VERSION_DEF "2.0b4"
  400. #define PERSONAL_VERSION_STRING "Netscape-FastTrack/2.0b4"
  401. #define CATALOG_VERSION_DEF "1.0b2"
  402. #define CATALOG_VERSION_STRING "Netscape-Catalog/1.0b2"
  403. #define RDS_VERSION_DEF "1.0b2"
  404. #define RDS_VERSION_STRING "Netscape-RDS/1.0b2"
  405. #define ENTERPRISE_VERSION_DEF "2.0b4"
  406. #define ENTERPRISE_VERSION_STRING "Netscape-Enterprise/2.0b4"
  407. #define NEWS_VERSION_STRING "Netscape 1.1"
  408. #define BATMAN_VERSION_DEF "1.0a1"
  409. #define BATMAN_VERSION_STRING "Batman/1.0a1"
  410. #define DAEMON_LISTEN_SIZE (Byte)(100)
  411. #define MAGNUS_ERROR_LEN (Word)(8192)
  412. #define CR (Byte)(13)
  413. #define LF (Byte)(10)
  414. #define ENDLINE "\r\n"
  415. #define ENTERPRISE_VERSION (Byte)(1)
  416. #define PERSONAL_VERSION (Byte)(2)
  417. #define CATALOG_VERSION (Byte)(3)
  418. #define RDS_VERSION (Byte)(4)
  419. #define SEM_ERROR (Byte)(0)
  420. #define SEM_MAXVALUE (Word)(32767)
  421. #define IO_OKAY (Byte)(1)
  422. #define IO_ERROR (Shortint)(-1)
  423. #define IO_EOF (Byte)(0)
  424. #define FILE_BUFFERSIZE (Word)(4096)
  425. #define SYS_ERROR_FD (void *)(0x0)
  426. #define SYS_STDERR (void *)(0x0)
  427. #define ERROR_PIPE (Word)(767)
  428. #define FILE_PATHSEP (char)(47)
  429. #define FILE_PARENT "..\\"
  430. #define NET_BUFFERSIZE (Word)(8192)
  431. #define NET_READ_TIMEOUT (Byte)(120)
  432. #define NET_WRITE_TIMEOUT (Word)(300)
  433. #define NET_INFINITE_TIMEOUT (Byte)(0)
  434. #define NET_ZERO_TIMEOUT (Shortint)(-1)
  435. #define SSL_HANDSHAKE_TIMEOUT (Word)(300)
  436. #define SYS_NET_ERRORFD (Shortint)(-1)
  437. #define SESSION_HASHSIZE (Byte)(5)
  438. #define MCC_MT_MAGIC "#--Mosaic Communications Corporation MIME Information"
  439. #define MCC_MT_MAGIC_LEN (Byte)(53)
  440. #define NCC_MT_MAGIC "#--Netscape Communications Corporation MIME Information"
  441. #define NCC_MT_MAGIC_LEN (Byte)(55)
  442. #define CINFO_SEPARATOR (char)(46)
  443. #define CINFO_MAX_LEN (Word)(1024)
  444. #define CINFO_HASHSIZE (Byte)(27)
  445. #define MAX_ERROR_LEN (Word)(8192)
  446. #define LOG_WARN (Byte)(0)
  447. #define LOG_MISCONFIG (Byte)(1)
  448. #define LOG_SECURITY (Byte)(2)
  449. #define LOG_FAILURE (Byte)(3)
  450. #define LOG_CATASTROPHE (Byte)(4)
  451. #define LOG_INFORM (Byte)(5)
  452. #define ERR_TIMEFMT "[%d/%b/%Y:%H:%M:%S]"
  453. #define ERRORS_TO_SYSLOG (Shortint)(-1)
  454. #define NON_SXP (Shortint)(-1)
  455. #define INVALID_SXP (Shortint)(-2)
  456. #define VALID_SXP (Byte)(1)
  457. #define NON_WILDPAT (Shortint)(-1)
  458. #define INVALID_WILDPAT (Shortint)(-2)
  459. #define VALID_WILDPAT (Byte)(1)
  460. #define NON_REGEXP (Shortint)(-1)
  461. #define INVALID_REGEXP (Shortint)(-2)
  462. #define VALID_REGEXP (Byte)(1)
  463. #define SYS_THREAD_ERROR (void *)(0x0)
  464. #define SYSTHREAD_DEFAULT_PRIORITY (Byte)(16)
  465. #define CHILD_EMPTY_SLOT (Byte)(254)
  466. #define CHILD_AWAIT_CONNECT (Byte)(255)
  467. #define CHILD_PROCESSING (Byte)(0)
  468. #define CHILD_READING (Byte)(1)
  469. #define CHILD_WRITING (Byte)(2)
  470. #define CHILD_RESOLVING (Byte)(3)
  471. #define CHILD_DONE_PROCESSING (Byte)(20)
  472. #define CHILD_DONE_READING (Byte)(21)
  473. #define CHILD_DONE_WRITING (Byte)(22)
  474. #define CHILD_DONE_RESOLVING (Byte)(23)
  475. #define MAX_IP_DOMAINS (Word)(256)
  476. #define OBJSET_INCSIZE (Byte)(8)
  477. #define MAX_DIRECTIVE_LEN (Word)(800)
  478. #define PARAMETER_HASH_SIZE (Byte)(3)
  479. #define CONF_MAXLEN (Word)(16384)
  480. #define DEFAULT_PORT (Byte)(80)
  481. #define DEFAULT_POOL_MAX (Byte)(50)
  482. #define REQ_HASHSIZE (Byte)(10)
  483. #define REQ_MAX_LINE (Word)(4096)
  484. #define REQ_PROCEED (Byte)(0)
  485. #define REQ_ABORTED (Shortint)(-1)
  486. #define REQ_NOACTION (Shortint)(-2)
  487. #define REQ_EXIT (Shortint)(-3)
  488. #define REQ_RESTART (Shortint)(-4)
  489. #define HTTP_DATE_LEN (Byte)(128)
  490. #define HTTP_DATE_FMT "%A, %d-%b-%y %H:%M:%S GMT"
  491. #define HTTP_DEFAULT_KEEPALIVE_TIMEOUT (Byte)(15)
  492. #define HTTP_MAX_HEADERS (Byte)(200)
  493. #define PROTOCOL_OK (Byte)(200)
  494. #define PROTOCOL_CREATED (Byte)(201)
  495. #define PROTOCOL_NO_RESPONSE (Byte)(204)
  496. #define PROTOCOL_PARTIAL_CONTENT (Byte)(206)
  497. #define PROTOCOL_REDIRECT (Word)(302)
  498. #define PROTOCOL_NOT_MODIFIED (Word)(304)
  499. #define PROTOCOL_BAD_REQUEST (Word)(400)
  500. #define PROTOCOL_UNAUTHORIZED (Word)(401)
  501. #define PROTOCOL_FORBIDDEN (Word)(403)
  502. #define PROTOCOL_NOT_FOUND (Word)(404)
  503. #define PROTOCOL_PROXY_UNAUTHORIZED (Word)(407)
  504. #define PROTOCOL_SERVER_ERROR (Word)(500)
  505. #define PROTOCOL_NOT_IMPLEMENTED (Word)(501)
  506. #define HTTP_PORT (Byte)(80)
  507. #define HTTP_URL "http"
  508. #define NUM_HASH (Byte)(20)
  509. extern PACKAGE bool __fastcall server_fasttrack(void);
  510. extern PACKAGE bool __fastcall server_enterprise(void);
  511. extern PACKAGE void __fastcall CONVERT_TO_PRINTABLE_FORMAT(char * Filename);
  512. extern PACKAGE void __fastcall CONVERT_TO_NATIVE_FS(char * Filename);
  513. extern PACKAGE BOOL __fastcall system_rename(char * Old, char * New);
  514. extern PACKAGE BOOL __fastcall system_unlink(char * path);
  515. extern PACKAGE int __fastcall system_lseek(SYS_FILE fd, int off, int wh);
  516. extern PACKAGE int __fastcall system_flock(SYS_FILE fd);
  517. extern PACKAGE int __fastcall system_ulock(SYS_FILE fd);
  518. extern PACKAGE int __fastcall dir_create(char * Path);
  519. extern PACKAGE int __fastcall dir_remove(char * Path);
  520. extern PACKAGE PPbParam __fastcall pblock_find(char * name, PPblock pb);
  521. extern PACKAGE PPbParam __fastcall pblock_remove(char * name, PPblock pb);
  522. extern PACKAGE int __fastcall netbuf_getc(PNetBuf b);
  523. extern PACKAGE int __fastcall filebuf_getc(PFileBuffer b);
  524. extern PACKAGE int __fastcall pipebuf_getc(PFileBuffer b);
  525. extern PACKAGE char * __fastcall session_dns(PSession sn);
  526. extern PACKAGE char * __fastcall session_maxdns(PSession sn);
  527. extern PACKAGE char __fastcall CINFO_HASH(char * s);
  528. extern PACKAGE int __fastcall request_loadheaders(PSession sn, PRequest rq);
  529. extern PACKAGE PPASSWD __fastcall userpw(void);
  530. extern PACKAGE int __fastcall pool_max(void);
  531. extern PACKAGE int __fastcall pool_min(void);
  532. extern PACKAGE int __fastcall pool_life(void);
  533. extern PACKAGE int __fastcall pool_maxthreads(void);
  534. extern PACKAGE int __fastcall pool_minthreads(void);
  535. extern PACKAGE char * __fastcall server_hostname(void);
  536. extern PACKAGE char * __fastcall root_object(void);
  537. extern PACKAGE PHttpdObjSet __fastcall std_os(void);
  538. extern PACKAGE void * __fastcall acl_root(void);
  539. extern PACKAGE char * __fastcall master_error_log(void);
  540. extern PACKAGE char * __fastcall server_root(void);
  541. extern PACKAGE char * __fastcall server_id(void);
  542. extern PACKAGE System::AnsiString __fastcall NSstr2String(char * nsStr);
  543. extern "C" int __cdecl strcasecmp(char * s1, char * s2);
  544. extern "C" int __cdecl strncasecmp(char * s1, char * s2, int n);
  545. extern "C" int __cdecl util_strcasecmp(char * s1, char * s2);
  546. extern "C" int __cdecl util_strncasecmp(char * s1, char * s2, int n);
  547. extern "C" char * __cdecl system_version(void);
  548. extern "C" char * __cdecl MAGNUS_VERSION_STRING(void);
  549. extern "C" void __cdecl system_version_set(char * ptr);
  550. extern "C" void * __cdecl MALLOC(int size);
  551. extern "C" void * __cdecl system_malloc(int size);
  552. extern "C" void * __cdecl CALLOC(int size);
  553. extern "C" void * __cdecl system_calloc(int size);
  554. extern "C" void * __cdecl REALLOC(void * ptr, int size);
  555. extern "C" void * __cdecl system_realloc(void * ptr, int size);
  556. extern "C" void __cdecl FREE(void * ptr);
  557. extern "C" void __cdecl system_free(void * ptr);
  558. extern "C" char * __cdecl STRDUP(char * ptr);
  559. extern "C" char * __cdecl system_strdup(char * ptr);
  560. extern "C" void * __cdecl PERM_MALLOC(int size);
  561. extern "C" void * __cdecl system_malloc_perm(int size);
  562. extern "C" void * __cdecl PERM_CALLOC(int size);
  563. extern "C" void * __cdecl system_calloc_perm(int size);
  564. extern "C" void * __cdecl PERM_REALLOC(void * ptr, int size);
  565. extern "C" void * __cdecl system_realloc_perm(void * ptr, int size);
  566. extern "C" void __cdecl PERM_FREE(void * ptr);
  567. extern "C" void __cdecl system_free_perm(void * ptr);
  568. extern "C" char * __cdecl PERM_STRDUP(char * ptr);
  569. extern "C" char * __cdecl system_strdup_perm(char * ptr);
  570. extern "C" void __cdecl magnus_atrestart(TAtRestart fn, void * data);
  571. extern "C" PPoolHandle __cdecl pool_create(void);
  572. extern "C" void __cdecl pool_destroy(PPoolHandle pool_handle);
  573. extern "C" BOOL __cdecl pool_enabled(void);
  574. extern "C" void * __cdecl pool_malloc(PPoolHandle pool_handle, int size);
  575. extern "C" void __cdecl pool_free(PPoolHandle pool_handle, void * ptr);
  576. extern "C" void * __cdecl pool_calloc(PPoolHandle pool_handle, int nelem, int elsize);
  577. extern "C" void * __cdecl pool_realloc(PPoolHandle pool_handle, void * ptr, int size);
  578. extern "C" char * __cdecl pool_strdup(PPoolHandle pool_handle, char * orig_str);
  579. extern "C" int __cdecl sem_init(char * name, int Number);
  580. extern "C" void __cdecl sem_terminate(int id);
  581. extern "C" int __cdecl sem_grab(int id);
  582. extern "C" int __cdecl sem_tgrab(int id);
  583. extern "C" int __cdecl sem_release(int id);
  584. extern "C" void * __cdecl crit_init(void);
  585. extern "C" void __cdecl crit_enter(void * id);
  586. extern "C" void __cdecl crit_exit(void * id);
  587. extern "C" void __cdecl crit_terminate(void * id);
  588. extern "C" void * __cdecl condvar_init(void * id);
  589. extern "C" void __cdecl condvar_wait(void * cv);
  590. extern "C" void __cdecl condvar_notify(void * cv);
  591. extern "C" void __cdecl condvar_terminate(void * cv);
  592. extern "C" BOOL __stdcall system_chdir(char * Path);
  593. extern "C" int __cdecl system_stat(char * name, TStat &finfo);
  594. extern "C" int __cdecl system_fread(SYS_FILE fd, void * buf, int sz);
  595. extern "C" int __cdecl system_pread(SYS_FILE fd, void * buf, int sz);
  596. extern "C" SYS_FILE __cdecl system_fopenRO(char * path);
  597. extern "C" SYS_FILE __cdecl system_fopenWA(char * path);
  598. extern "C" SYS_FILE __cdecl system_fopenRW(char * path);
  599. extern "C" SYS_FILE __cdecl system_fopenWT(char * path);
  600. extern "C" void __cdecl system_fclose(SYS_FILE fd);
  601. extern "C" int __cdecl system_nocoredumps(void);
  602. extern "C" char * __cdecl system_winsockerr(void);
  603. extern "C" char * __cdecl system_winerr(void);
  604. extern "C" int __cdecl system_fwrite(SYS_FILE fd, void * buf, int sz);
  605. extern "C" int __cdecl system_fwrite_atomic(SYS_FILE fd, void * buf, int sz);
  606. extern "C" int __cdecl file_notfound(void);
  607. extern "C" char * __cdecl system_errmsg(void);
  608. extern "C" char * __cdecl system_errmsg_fn(void);
  609. extern "C" int __cdecl system_initlock(SYS_FILE fd);
  610. extern "C" int __cdecl file_setinherit(SYS_FILE fd, int value);
  611. extern "C" void __cdecl file_unix2local(char * path, char * p2);
  612. extern "C" PDir __cdecl dir_open(char * path);
  613. extern "C" PDirEnt __cdecl dir_read(PDir ds);
  614. extern "C" void __cdecl dir_close(PDir ds);
  615. extern "C" int __cdecl dir_create_all(char * dir);
  616. extern "C" PPbParam __cdecl param_create(char * name, char * value);
  617. extern "C" int __cdecl param_free(PPbParam pp);
  618. extern "C" PPblock __cdecl pblock_create(int n);
  619. extern "C" void __cdecl pblock_free(PPblock pb);
  620. extern "C" char * __cdecl pblock_findval(char * name, PPblock pb);
  621. extern "C" PPbParam __cdecl pblock_nvinsert(char * name, char * value, PPblock pb);
  622. extern "C" PPbParam __cdecl pblock_nninsert(char * name, int value, PPblock pb);
  623. extern "C" void __cdecl pblock_pinsert(PPbParam pp, PPblock pb);
  624. extern "C" int __cdecl pblock_str2pblock(char * str, PPblock pb);
  625. extern "C" char * __cdecl pblock_pblock2str(PPblock pb, char * str);
  626. extern "C" void __cdecl pblock_copy(PPblock src, PPblock dst);
  627. extern "C" PPblock __cdecl pblock_dup(PPblock src);
  628. extern "C" PPCharArray __fastcall pblock_pb2env(PPblock pb, PPCharArray env);
  629. extern PACKAGE PPbParam __cdecl _pblock_fr(char * name, PPblock pb, BOOL remove);
  630. extern "C" int __cdecl net_socket(int domain, int nettype, int protocol);
  631. extern "C" int __cdecl net_getsockopt(int s, int level, int optname, void * optval, int &optlen);
  632. extern "C" int __cdecl net_setsockopt(int s, int level, int optname, void * optval, int optlen);
  633. extern "C" int __cdecl net_listen(int s, int backlog);
  634. extern "C" int __cdecl net_create_listener(char * ipaddr, int port);
  635. extern "C" int __cdecl net_select(int nfds, Winsock::PFDSet r, Winsock::PFDSet w, Winsock::PFDSet e, 
  636.     Winsock::PTimeVal timeout);
  637. extern "C" int __cdecl net_connect(int s, void * sockaddr, int namelen);
  638. extern "C" int __cdecl net_ioctl(int s, int tag, void * result);
  639. extern "C" int __cdecl net_getpeername(int s, sockaddr_in &name, int &namelen);
  640. extern "C" int __cdecl net_close(int s);
  641. extern "C" int __cdecl net_bind(int s, sockaddr_in &name, int namelen);
  642. extern "C" int __cdecl net_accept(int s, PSOCKADDR addr, Windows::PInteger addrlen);
  643. extern "C" int __cdecl net_read(int sd, char * buf, int sz, int timeout);
  644. extern "C" int __cdecl net_write(int sd, char * buf, int sz);
  645. extern "C" BOOL __cdecl net_isalive(int sd);
  646. extern "C" char * __cdecl net_ip2host(char * ip, BOOL verify);
  647. extern "C" PFileBuffer __cdecl filebuf_open(SYS_FILE fd, int sz);
  648. extern "C" PNetBuf __cdecl netbuf_open(int sd, int sz);
  649. extern "C" PFileBuffer __cdecl filebuf_create(SYS_FILE fd, char * mmap_ptr, int mmap_len, int bufsz)
  650.     ;
  651. extern "C" void __cdecl filebuf_close_buffer(PFileBuffer buf, BOOL clean_mmap);
  652. extern "C" PFileBuffer __cdecl filebuf_open_nostat(SYS_FILE fd, int sz, TStat &finfo);
  653. extern "C" PFileBuffer __cdecl pipebuf_open(SYS_FILE fd, int sz, TStat &finfo);
  654. extern "C" int __cdecl filebuf_next(PFileBuffer buf, int advance);
  655. extern "C" int __cdecl netbuf_next(PNetBuf buf, int advance);
  656. extern "C" int __cdecl pipebuf_next(PFileBuffer buf, int advance);
  657. extern "C" void __cdecl filebuf_close(PFileBuffer buf);
  658. extern "C" void __cdecl netbuf_close(PNetBuf buf);
  659. extern "C" void __cdecl pipebuf_close(PFileBuffer buf);
  660. extern "C" int __cdecl filebuf_grab(PFileBuffer buf, int sz);
  661. extern "C" int __cdecl netbuf_grab(PNetBuf buf, int sz);
  662. extern "C" int __cdecl pipebuf_grab(PFileBuffer buf, int sz);
  663. extern "C" int __cdecl netbuf_buf2sd(PNetBuf buf, int sd, int len);
  664. extern "C" int __cdecl filebuf_buf2sd(PFileBuffer buf, int sd);
  665. extern "C" int __cdecl pipebuf_buf2sd(PFileBuffer buf, int sd, int len);
  666. extern "C" int __cdecl pipebuf_netbuf2sd(PNetBuf buf, SYS_FILE sd, int len);
  667. extern "C" PSession __cdecl session_create(int csd, Winsock::PSockAddrIn sac);
  668. extern "C" void __fastcall session_free(PSession sn);
  669. extern "C" char * __cdecl session_dns_lookup(PSession sn, BOOL verify);
  670. extern "C" void __cdecl cinfo_init(void);
  671. extern "C" void __cdecl cinfo_terminate(void);
  672. extern "C" char * __cdecl cinfo_merge(char * fn);
  673. extern "C" PCInfo __cdecl cinfo_find(char * uri);
  674. extern "C" PCInfo __cdecl cinfo_lookup(char * ctype);
  675. extern "C" char * __cdecl ereport_init(char * err_fn, char * email, void * &pw);
  676. extern "C" void __cdecl ereport_terminate(void);
  677. extern "C" SYS_FILE __cdecl ereport_getfd(void);
  678. extern "C" int __cdecl shexp_valid(char * exp);
  679. extern "C" int __cdecl shexp_match(char * str, char * exp);
  680. extern "C" int __cdecl shexp_cmp(char * str, char * exp);
  681. extern "C" int __cdecl shexp_casecmp(char * str, char * exp);
  682. extern "C" PShMem __cdecl shmem_alloc(char * name, int size, BOOL expose);
  683. extern "C" void __cdecl shmem_free(PShMem region);
  684. extern "C" void * __cdecl systhread_start(int prio, int stksz, TSysThreadFunc fn, void * arg);
  685. extern "C" void * __fastcall systhread_current(void);
  686. extern "C" void __cdecl systhread_yield(void);
  687. extern "C" void * __cdecl systhread_attach(void);
  688. extern "C" void __fastcall systhread_terminate(void * thr);
  689. extern "C" void __cdecl systhread_sleep(int milliseconds);
  690. extern "C" void __cdecl systhread_init(char * name);
  691. extern "C" void __cdecl systhread_timerset(int usec);
  692. extern "C" int __cdecl systhread_newkey(void);
  693. extern "C" void * __cdecl systhread_getdata(int key);
  694. extern "C" void __cdecl systhread_setdata(int key, void * data);
  695. extern PACKAGE void __cdecl _ntdaemon_run(void * Param);
  696. extern "C" void __cdecl daemon_atrestart(TAtRestart fn, void * data);
  697. extern "C" int __fastcall child_fork(void);
  698. extern "C" int __cdecl util_getline(PFileBuffer buf, int lineno, int maxlen, char * l);
  699. extern "C" PPCharArray __cdecl util_env_create(PPCharArray env, int n, int &pos);
  700. extern "C" char * __cdecl util_env_str(char * name, char * value);
  701. extern "C" void __cdecl util_env_replace(PPCharArray env, char * name, char * value);
  702. extern "C" void __cdecl util_env_free(PPCharArray env);
  703. extern "C" PPCharArray __cdecl util_env_copy(PPCharArray src, PPCharArray dst);
  704. extern "C" char * __cdecl util_env_find(PPCharArray env, char * name);
  705. extern "C" char * __cdecl util_hostname(void);
  706. extern "C" int __fastcall util_chdir2path(char * path);
  707. extern "C" BOOL __cdecl util_is_mozilla(char * ua, char * major, char * minor);
  708. extern "C" BOOL __cdecl util_is_url(char * url);
  709. extern "C" BOOL __cdecl util_later_than(tm &lms, char * ims);
  710. extern "C" BOOL __cdecl util_time_equal(tm &lms, char * ims);
  711. extern "C" int __cdecl util_str_time_equal(char * t1, char * t2);
  712. extern "C" BOOL __cdecl util_uri_is_evil(char * t);
  713. extern "C" void __cdecl util_uri_parse(char * uri);
  714. extern "C" void __cdecl util_uri_unescape(char * s);
  715. extern "C" char * __cdecl util_uri_escape(char * d, char * s);
  716. extern "C" char * __cdecl util_url_escape(char * d, char * s);
  717. extern "C" char * __cdecl util_sh_escape(char * s);
  718. extern "C" int __fastcall util_mime_separator(char * sep);
  719. extern "C" int __fastcall util_itoa(int i, char * a);
  720. extern "C" void __cdecl util_delete_directory(char * FileName, BOOL delete_directory);
  721. extern "C" int __cdecl util_strftime(char * s, char * format, tm &t);
  722. extern "C" PHttpdObject __cdecl object_create(int nd, PPblock name);
  723. extern "C" void __cdecl object_free(PHttpdObject obj);
  724. extern "C" void __cdecl object_add_directive(int dc, PPblock p, PPblock c, PHttpdObject obj);
  725. extern "C" int __cdecl object_execute(PDirective inst, PSession sn, void * rq);
  726. extern "C" PHttpdObjSet __cdecl objset_scan_buffer(PFileBuffer buf, char * errstr, PHttpdObjSet os);
  727.     
  728. extern "C" PHttpdObjSet __cdecl objset_create(void);
  729. extern "C" void __cdecl objset_free(PHttpdObjSet os);
  730. extern "C" void __cdecl objset_free_setonly(PHttpdObjSet os);
  731. extern "C" PHttpdObjSet __cdecl objset_new_object(PPblock name, PHttpdObjSet os);
  732. extern "C" void __cdecl objset_add_object(PHttpdObject obj, PHttpdObjSet os);
  733. extern "C" void __cdecl objset_add_init(PPblock initfn, PHttpdObjSet os);
  734. extern "C" PHttpdObject __cdecl objset_findbyname(char * name, PHttpdObjSet ign, PHttpdObjSet os);
  735. extern "C" PHttpdObject __cdecl objset_findbyppath(char * ppath, PHttpdObjSet ign, PHttpdObjSet os);
  736.     
  737. extern "C" PHttpdObjSet __cdecl objset_copydirs(PHttpdObjSet dst_os, PHttpdObjSet os, int dir);
  738. extern "C" PHttpdObjSet __cdecl objset_scan_registry(char * errstr, PHttpdObjSet os, char * product_key
  739.     );
  740. extern "C" void __cdecl ProcessObject(PHttpdObjSet nos, HKEY hObjectKey, char * Obj, int ObjectIndex
  741.     );
  742. extern "C" BOOL __cdecl ProcessClient(PHttpdObject cobj, HKEY hObjectKey, char * Client, int ObjectIndex
  743.     );
  744. extern "C" BOOL __cdecl ProcessDirective(PHttpdObject cobj, PPblock param, PPblock client, HKEY hObjectKey
  745.     , char * Directive, int ObjectIndex, int DirectiveIndex, int &clrefs, BOOL IsObject);
  746. extern "C" BOOL __cdecl ProcessFunction(PPblock ¶m, HKEY hDirectiveKey, char * Func, int ObjectIndex
  747.     , int DirectiveIndex, int FunctionIndex);
  748. extern PACKAGE int __cdecl _ntverify_parameter(char * str);
  749. extern "C" int __cdecl ntpblock_str2pblock(int ParameterIndex, char * name, char * value, int namelength
  750.     , int valuelength, PPblock pb);
  751. extern "C" int __cdecl ntpblock_pblock2str(PPbEntry p, char * &ParameterName, char * &ParameterValue
  752.     );
  753. extern "C" BOOL __cdecl ClearConfigurationParameters(HKEY hParentKey, char * CompleteKeyName, char * 
  754.     KeyName);
  755. extern "C" char * __cdecl GetProductKey(void);
  756. extern "C" char * __cdecl conf_init(char * cfn);
  757. extern "C" void __cdecl conf_terminate(void);
  758. extern "C" PConfGlobalVars __cdecl conf_getglobals(void);
  759. extern "C" void __cdecl conf_vars2daemon(PDaemon d);
  760. extern "C" BOOL __cdecl GetDomainAddresses(char * ErrMsg);
  761. extern "C" PRequest __cdecl request_create(void);
  762. extern "C" void __cdecl request_free(PRequest req);
  763. extern "C" PRequest __cdecl request_restart_internal(char * uri, PRequest rq);
  764. extern "C" int __cdecl request_header(char * name, PPCharArray value, PSession sn, PRequest rq);
  765. extern "C" PStat __cdecl request_stat_path(char * path, PRequest rq);
  766. extern "C" void __cdecl request_handle(PSession sn);
  767. extern "C" char * __cdecl request_translate_uri(char * uri, PSession sn);
  768. extern "C" PRequest __cdecl protocol_find_request(PNetBuf buf, PSession sn, int &reply);
  769. extern "C" PRequest __cdecl http_find_request(PNetBuf buf, PSession sn, int &reply);
  770. extern "C" int __cdecl protocol_parse_request(char * t, PRequest rq, PSession sn);
  771. extern "C" int __cdecl http_parse_request(char * t, PRequest rq, PSession sn);
  772. extern "C" int __cdecl protocol_scan_headers(PSession sn, PNetBuf buf, char * t, PPblock headers);
  773. extern "C" int __cdecl http_scan_headers(PSession sn, PNetBuf buf, char * t, PPblock headers);
  774. extern "C" int __cdecl protocol_start_response(PSession sn, PRequest rq);
  775. extern "C" int __cdecl http_start_response(PSession sn, PRequest rq);
  776. extern "C" PPCharArray __cdecl http_hdrs2env(PPblock pb);
  777. extern "C" void __cdecl protocol_status(PSession sn, PRequest rq, int n, char * r);
  778. extern "C" void __cdecl http_status(PSession sn, PRequest rq, int n, char * r);
  779. extern "C" int __cdecl protocol_set_finfo(PSession sn, PRequest rq, TStat &finfo);
  780. extern "C" int __cdecl http_set_finfo(PSession sn, PRequest rq, TStat &finfo);
  781. extern "C" char * __cdecl http_dump822(PPblock pb, char * t, int &pos, int tsz);
  782. extern "C" void __cdecl protocol_finish_request(PSession sn, PRequest rq);
  783. extern "C" void __cdecl http_finish_request(PSession sn, PRequest rq);
  784. extern "C" void __cdecl protocol_handle_session(PSession sn);
  785. extern "C" void __cdecl http_handle_session(PSession sn);
  786. extern "C" char * __cdecl protocol_uri2url(char * prefix, char * suffix);
  787. extern "C" char * __cdecl protocol_uri2url_dynamic(char * prefix, char * suffix, PSession sn, PRequest 
  788.     rq);
  789. extern "C" char * __cdecl http_uri2url(char * prefix, char * suffix);
  790. extern "C" char * __cdecl http_uri2url_dynamic(char * prefix, char * suffix, PSession sn, PRequest rq
  791.     );
  792. extern "C" void __cdecl protocol_set_keepalive_timeout(int secs);
  793. extern "C" void __cdecl http_set_keepalive_timeout(int secs);
  794. extern "C" void __cdecl func_init(void);
  795. extern "C" TFunction __cdecl func_find(char * name);
  796. extern "C" int __cdecl func_exec(PPblock pb, PSession sn, PRequest rq);
  797. extern "C" PFuncStruct __fastcall func_insert(char * name, TFunction fn);
  798. inline void * __cdecl MALLOC(int size)
  799. {
  800.     return system_malloc(size);
  801. }
  802.  
  803. inline void * __cdecl CALLOC(int size)
  804. {
  805.     return system_calloc(size);
  806. }
  807.  
  808. inline void * __cdecl REALLOC(void * ptr, int size)
  809. {
  810.     return system_realloc(ptr, size);
  811. }
  812.  
  813. inline void __cdecl FREE(void * ptr)
  814. {
  815.     system_free(ptr);
  816. }
  817.  
  818. inline char * __cdecl STRDUP(char * ptr)
  819. {
  820.     return system_strdup(ptr);
  821. }
  822.  
  823. inline void * __cdecl PERM_MALLOC(int size)
  824. {
  825.     return system_malloc_perm(size);
  826. }
  827.  
  828. inline void * __cdecl PERM_CALLOC(int size)
  829. {
  830.     return system_calloc_perm(size);
  831. }
  832.  
  833. inline void * __cdecl PERM_REALLOC(void * ptr, int size)
  834. {
  835.     return system_realloc_perm(ptr, size);
  836. }
  837.  
  838. inline void __cdecl PERM_FREE(void * ptr)
  839. {
  840.     system_free_perm(ptr);
  841. }
  842.  
  843. inline char * __cdecl PERM_STRDUP(char * ptr)
  844. {
  845.     return system_strdup_perm(ptr);
  846. }
  847.  
  848. inline BOOL __stdcall system_chdir(char * Path)
  849. {
  850.     return SetCurrentDirectory(Path);
  851. }
  852.  
  853. inline char * __cdecl system_errmsg(void)
  854. {
  855.     return system_errmsg_fn();
  856. }
  857.  
  858. inline char * __cdecl request_translate_uri(char * uri, PSession sn)
  859. {
  860.     return servact_translate_uri(uri, sn);
  861. }
  862.  
  863. inline PRequest __cdecl protocol_find_request(PNetBuf buf, PSession sn, int &reply)
  864. {
  865.     return http_find_request(buf, sn, reply);
  866. }
  867.  
  868. inline int __cdecl protocol_parse_request(char * t, PRequest rq, PSession sn)
  869. {
  870.     return http_parse_request(t, rq, sn);
  871. }
  872.  
  873. inline int __cdecl protocol_scan_headers(PSession sn, PNetBuf buf, char * t, PPblock headers)
  874. {
  875.     return http_scan_headers(sn, buf, t, headers);
  876. }
  877.  
  878. inline int __cdecl protocol_start_response(PSession sn, PRequest rq)
  879. {
  880.     return http_start_response(sn, rq);
  881. }
  882.  
  883. inline void __cdecl protocol_status(PSession sn, PRequest rq, int n, char * r)
  884. {
  885.     http_status(sn, rq, n, r);
  886. }
  887.  
  888. inline int __cdecl protocol_set_finfo(PSession sn, PRequest rq, TStat &finfo)
  889. {
  890.     return http_set_finfo(sn, rq, finfo);
  891. }
  892.  
  893. inline void __cdecl protocol_finish_request(PSession sn, PRequest rq)
  894. {
  895.     http_finish_request(sn, rq);
  896. }
  897.  
  898. inline void __cdecl protocol_handle_session(PSession sn)
  899. {
  900.     http_handle_session(sn);
  901. }
  902.  
  903. inline char * __cdecl protocol_uri2url(char * prefix, char * suffix)
  904. {
  905.     return http_uri2url(prefix, suffix);
  906. }
  907.  
  908. inline char * __cdecl protocol_uri2url_dynamic(char * prefix, char * suffix, PSession sn, PRequest rq
  909.     )
  910. {
  911.     return http_uri2url_dynamic(prefix, suffix, sn, rq);
  912. }
  913.  
  914. inline void __cdecl protocol_set_keepalive_timeout(int secs)
  915. {
  916.     http_set_keepalive_timeout(secs);
  917. }
  918.  
  919.  
  920. }    /* namespace Nsapi */
  921. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  922. using namespace Nsapi;
  923. #endif
  924. //-- end unit ----------------------------------------------------------------
  925. #endif    // NSApi
  926.